package com.mushuilingfeng.ddd.user.domain.user.service.impl;

import cn.hutool.core.codec.Base64Encoder;
import com.mushuilingfeng.ddd.framework.AsSpringBean;
import com.mushuilingfeng.ddd.user.domain.user.service.IPasswordService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 沐水淋风
 * @date 2024/10/6
 */
@AsSpringBean
@Slf4j
public class PasswordServiceImpl implements IPasswordService {
    
    @Override
    public String encrypt(String password) {
        return Base64Encoder.encode(password);
    }
    
    @Override
    public boolean verify(String password, String encryptPassword) {
        return Base64Encoder.encode(password).equals(encryptPassword);
    }
}
